package action;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import biz.CartBiz;

import dao.ItemDAO;

import util.ActionForward;
import vo.Item;

public class ItemCartAddAction implements Action{

	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		int itemid=Integer.parseInt(request.getParameter("itemid"));
		
		ItemDAO dao = ItemDAO.getInstance();
		Item item=dao.getItem(itemid);
		
		CartBiz cartBiz = new CartBiz();
		cartBiz.addCart(request, item);
		
		ActionForward forward = new ActionForward();
		forward.setUrl("itemCartList.do");
		forward.setRedirect(true);
		return forward;
	}

}










